/*
 * =====================================================================================
 *
 *       Filename:  OuterUserInfo.cc
 *
 *    Description:
 *
 *        Version:  1.0
 *        Created:  01/10/2022 03:43:54 PM
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  first_name last_name (fl), fl@my-company.com
 *        Company:  my-company
 *
 * =====================================================================================
 */

#include "OuterUserInfo.h"
#include "OuterUserBaseInfo.h"
#include "OuterUserOfficeInfo.h"
#include "OuterUser.h"
#include <iostream>
using std::cout;
using std::endl;
using std::string;

COuterUserInfo::COuterUserInfo(void) {
    m_pOuterUser = new COuterUser();
}

COuterUserInfo::~COuterUserInfo(void) {
    delete m_pOuterUser;
}

string COuterUserInfo::GetUserName() {
    COuterUserBaseInfo* pBaseInfo = m_pOuterUser->GetUserBaseInfo();
    string name = pBaseInfo->GetUserName();
    delete pBaseInfo;
    pBaseInfo = NULL;
    return name;
}

string COuterUserInfo::GetHomeAddress() {
    COuterUserHomeInfo* pHomeInfo = m_pOuterUser->GetUserHomeInfo();
    pHomeInfo->GetHomeAddress();
    delete pHomeInfo;
    pHomeInfo = NULL;
    return "0";
}

string COuterUserInfo::GetMobileNumber() {
    COuterUserBaseInfo* pBaseInfo = m_pOuterUser->GetUserBaseInfo();
    string number = pBaseInfo->GetMobileNumber();
    delete pBaseInfo;
    pBaseInfo = NULL;
    return number;
}

string COuterUserInfo::GetOfficeTelNumber() {
    COuterUserOfficeInfo* pOfficeInfo = m_pOuterUser->GetUserOfficeInfo();
    string num = pOfficeInfo->GetOfficeTelNumber();
    delete pOfficeInfo;
    pOfficeInfo = NULL;
    return num;
}

string COuterUserInfo::GetJobPosition() {
    COuterUserOfficeInfo* pOfficeInfo = m_pOuterUser->GetUserOfficeInfo();
    string ret = pOfficeInfo->GetJobPosition();
    delete pOfficeInfo;
    pOfficeInfo = NULL;
    return ret;
}

string COuterUserInfo::GetHomeTelNumber() {
    COuterUserHomeInfo* pHomeInfo = m_pOuterUser->GetUserHomeInfo();
    string ret = pHomeInfo->GetHomeTelNumber();
    delete pHomeInfo;
    pHomeInfo = NULL;
    return ret;
}
